<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>网站模块配置项</title>
<script type="text/javascript" charset="utf-8" src="${pageContext.request.contextPath}/statics/js/clipboard.min.js"></script>
 <%@ include file="/page/include.jsp" %>
<link rel="stylesheet" type="text/css" href="${rootPath}/statics/plugins/zTree/css/zTreeStyle/zTreeStyle.css" />
<script type="text/javascript" charset="utf-8" src="${pageContext.request.contextPath}/statics/plugins/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="${pageContext.request.contextPath}/statics/plugins/ueditor/ueditor.all.min.js"></script>

<link rel="stylesheet" type="text/css" href="<%=basePath%>/statics/plugins/jqwidgets-ver3.9.1/jqwidgets/styles/jqx.base.css" />
<link rel="stylesheet" type="text/css" href="<%=basePath%>/statics/plugins/jqwidgets-ver3.9.1/jqwidgets/styles/jqx.office.css" />
<style type="text/css">
.error {
	color: red;
	padding-left: 10px;
}
</style>
</head>
<body class="nav-md" style="background-color: #f7f7f7">
	<div class="container body">
		<div class="main_container">
			<div class="framebody" style="min-height: 100%;" role="main">

				<ul id="myTab" class="nav nav-tabs">
					<li><a class="active" href="#site_config_base" data-toggle="tab">配置信息</a></li>
					<li><a href="#site_config_doc" data-toggle="tab">图文信息</a></li>
					<li><a href="#site_config_category" data-toggle="tab">商品分类</a></li>
					<li><a href="#site_config_tag" data-toggle="tab">商品标签</a></li>
					<li><a href="#site_config_brand" data-toggle="tab">品牌</a></li>
				</ul>
				<!-- 隐藏域 end -->
				<div id="myTabContent" class="tab-content">
					<!-- 配置信息 Tab 开始 -->
					<div class="tab-pane fade in active" id="site_config_base">
						<div class="row">
							<div class="x_panel">
								<div class="x_content">
									<form class="form-horizontal form-label-left" novalidate id="siteConfigItemForm" name="siteConfigItemForm" method="post"
										action="${pageContext.request.contextPath}/siteConfigItem/saveOrUpdateSiteConfigItem">
										<input type="hidden" id="id" name="id" value="${siteConfigItem.id }">
										<input type="hidden" id="termType" value="${termType }" >
										<div class="item form-group">
											<label class="control-label col-md-2 col-sm-2 col-xs-12"
												for="roleName"><font style="color:red;">*</font>所属模块 : </label>
											<div class="col-md-5 col-sm-5 col-xs-12">
												<select id="moduleId" name="moduleId"
													value="${siteConfigItem.moduleId }"
													class="selectpicker form-control col-md-3 col-xs-12"
													title="请选择"
													<c:if test="${opFlag eq 'edit' }">data-live-search="true"</c:if>>
													<c:if test="${opFlag == 'edit' }">
														<c:forEach var="item" items="${smeList }"
															varStatus="status">
															<c:if test="${item.id == siteConfigItem.moduleId }">
																<option value="${item.id }"
																	<c:if test="${item.id == siteConfigItem.moduleId}">selected</c:if>>${item.moduleName }</option>
															</c:if>
														</c:forEach>
													</c:if>
													<c:if test="${opFlag == 'add' }">
														<c:forEach var="item" items="${smeList }" varStatus="status">
															<option value="${item.id }" <c:if test="${item.id == moduleId}">selected</c:if>>${item.moduleName }</option>
														</c:forEach>
													</c:if>
												</select>

											</div>
										</div>
										<div class="item form-group">
											<label class="control-label col-md-2 col-sm-2 col-xs-12"
												for="roleName"><font style="color:red;">*</font>配置标题: </label>
											<div class="col-md-5 col-sm-5 col-xs-12">
												<input id="configTitle" name="configTitle"
													value="${siteConfigItem.configTitle }"
													class="form-control col-md-3 col-xs-12" type="text">
											</div>
										</div>
										<div class="item form-group">
											<label class="control-label col-md-2 col-sm-2 col-xs-12"
												for="roleName">二级标题: </label>
											<div class="col-md-5 col-sm-5 col-xs-12">
												<input id="secondTitle" name="secondTitle"
													value="${siteConfigItem.secondTitle }"
													class="form-control col-md-3 col-xs-12" type="text">
											</div>
										</div>
										<div class="item form-group">
											<label class="control-label col-md-2 col-sm-2 col-xs-12"
												for="roleName"><font style="color:red;">*</font>配置类型 </label>
											<div class="col-md-5 col-sm-5 col-xs-12">
												<select id="configType" name="configType"
													class="selectpicker form-control col-md-12"
													value="${siteConfigItem.configType }">
													<option value="">全部</option>
												</select>
												<input type="hidden"  id="tmpConfigType" name="tmpConfigType"  value="${siteConfigItem.configType }"/>
											</div>
											
										</div>
										<div class="item form-group" id="imageContainer">
											<label class="control-label col-md-2 col-sm-2 col-xs-12"
												for="roleName">图片地址: </label>
											<div class="col-md-5 col-sm-5 col-xs-12">
											
												<div class="uploadpic_part">
													<ul class="image_container">
														<c:forEach items="${siteConfigItem.imageList }" var="image">
															<li>
																<div class="pic1">
																	<a rel="image" href="<%=PublicConfig.IMG_ROOT_URL%>${image }">
																		<img src="<%=PublicConfig.IMG_ROOT_URL%>${image }?x-oss-process=image/resize,h_60/format,png" />
																	</a>
																	<a href="javascript:void(0)" onclick="clearImage(this,'image')" class="icon_close"></a> 
																</div>
															</li>
														</c:forEach>
														<c:if test="${empty siteConfigItem.imageList}">
															<li>
																<div class="pic1">
																	<img src="${rootPath }/statics/images/upload_pic1.png" />
																	<input id="upload_image" name="imagePath" type="file" onchange="ajaxFileUpload(this,'image')" />
																</div>
															</li>
														</c:if>
													</ul>
													<input type="hidden" id="uploadImage" name="uploadImage" value="<c:if test="${not empty siteConfigItem.imageList}">${siteConfigItem.imageList[0]}</c:if>" />
												</div>
												<span class="pictips">建议尺寸：800像素 * 800像素</span>
												
											</div>
										</div>
										<div class="item form-group">
											<label class="control-label col-md-2 col-sm-2 col-xs-12"
												for="roleName"><font style="color:red;">*</font>连接(URL): </label>
											<div class="col-md-8 col-sm-8 col-xs-7">
												<input id="linkUrl" name="linkUrl" 
													value="${siteConfigItem.linkUrl }"
													class="form-control col-md-12 col-xs-12" type="text">
											</div>
										</div>
										<%--
										<div class="item form-group">
											<label class="control-label col-md-2 col-sm-2 col-xs-12"
												for="roleName"><font style="color:red;">*</font>排序: </label>
											<div class="col-md-2 col-sm-2 col-xs-12">
												<input id="sortNo" name="sortNo" value="${siteConfigItem.sortNo }"
													class="form-control col-md-3 col-xs-12" type="text" placeholder="整数排序号，从小到大升序排列">
											</div>
										</div>
										 --%>
										<div class="item form-group">
											<label class="control-label col-md-2 col-sm-2 col-xs-12"
												for="roleName">已关联商品: </label>
											<div class="col-md-8 col-sm-8 col-xs-12">
												<input id="productCode" class="form-control col-md-12 col-xs-12"  name="productCode" value="${siteConfigItem.productCode }" readonly="readonly" />
											</div>
										</div>
										<div class="item form-group">
											<label class="control-label col-md-2 col-sm-2 col-xs-12"
												for="roleName">商品名称: </label>
											<div class="col-md-4 col-sm-4 col-xs-12">
												<input id="productName" name="productName"  class="form-control col-md-3 col-xs-12" type="text" placeholder="请输入商品名称进行查询">
											</div>
											<div class="col-md-1 col-sm-1 col-xs-12">
												<button id="btn_product_selector" class="btn btn-success pull-right">查询</button>
											</div>
										</div>
										<div class="item form-group">
											<label class="control-label col-md-2 col-sm-2 col-xs-12"
												for="roleName"></label>
											<div class="col-md-8 col-sm-8 col-xs-12">
												<table id="productTable" class="table" style="height:150px;"></table>
											</div>
										</div>
										<input type="hidden"  name="content"  id="content" />
									</form>
								</div>
							</div>
						</div>
					</div>
					<!-- 配置信息 Tab 结束 -->
					
					<!-- 图文消息 Tab 开始 -->
					<div class="tab-pane fade" id="site_config_doc">
						<div class="row">
							<div class="item form-group">
								<div class="col-md-10">
									<script type="text/plain" id="editorDesc" style="width: 100%; height: 500px;">${siteConfigItem.content}</script>
									<script type="text/javascript">
										var ue = UE.getEditor(
														'editorDesc',
														{
															//这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
															//focus时自动清空初始化时的内容
															autoClearinitialContent : false,
															//关闭字数统计
															wordCount : false,
															imageUrlPrefix : '<%=PublicConfig.IMG_ROOT_URL%>',
															//默认的编辑区域高度
															initialFrameWidth : 900,
															//默认的编辑区域高度
															initialFrameHeight : 400,
															//关闭elementPath
															elementPathEnabled : false
														});

										UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
										UE.Editor.prototype.getActionUrl = function(action) {
											if (action == 'uploadimage'
													|| action == 'uploadscrawl'
													|| action == 'uploadimage') {
												return '${pageContext.request.contextPath}/product/multiFileUeditorUpload.do';
											} else {
												return this._bkGetActionUrl.call(this, action);
											}
										};
									</script>
									<span id="productIntro" name="productIntro" style="display: none;">${product.productIntro }</span>
								</div>
							</div>
						</div>
					</div>
					<!-- 图文消息 Tab 结束 -->
					
					<!-- 商品分类TAB 开始 -->
					<div class="tab-pane fade" id="site_config_category">
						<div id="treeGrid" ></div>
					</div>
					<!-- 商品分类TAB 结束 -->
					
					<!-- 商品标签TAB 开始 -->
					<div class="tab-pane fade" id="site_config_tag">
						<div class="row">
							<table id="productTagTable" class="table"></table>
						</div>
					</div>
					<!-- 商品标签TAB 结束 -->
					
					<!-- 商品品牌TAB 开始 -->
					<div class="tab-pane fade" id="site_config_brand">
						<div id="brandTreeGrid" ></div>
					</div>
					<!-- 商品品牌TAB 结束 -->
					
					
				</div>
				
				<div class="ln_solid"></div>
                    <div class="form-btn-content">
                          <a id="btn_save" class="btn btn-primary">确定</a>
                          <a id="btn_back"class="btn btn-default">返回</a>
                     </div>
				
				
			</div>
		</div>
	</div>
</body>



<script type="text/javascript" src="${rootPath}/statics/plugins/jqwidgets-ver3.9.1/jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="${rootPath}/statics/plugins/jqwidgets-ver3.9.1/jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="${rootPath}/statics/plugins/jqwidgets-ver3.9.1/jqwidgets/jqxscrollbar.js"></script>
<script type="text/javascript" src="${rootPath}/statics/plugins/jqwidgets-ver3.9.1/jqwidgets/jqxdatatable.js"></script>
<script type="text/javascript" src="${rootPath}/statics/plugins/jqwidgets-ver3.9.1/jqwidgets/jqxtreegrid.js"></script>
<script type="text/javascript" src="${rootPath}/statics/plugins/jqwidgets-ver3.9.1/jqwidgets/jqxdata.js"></script>

<script type="text/javascript" src="${rootPath }/statics/plugins/upload/ajaxfileupload.js"></script>
<script type="text/javascript"  src="${rootPath}/js/home/siteConfigItem_form.js?v=20180202"></script>
</html>